{% extends "base_generic.html" %}
{% block script %}
<script type="text/javascript">
  function generateUrl(name) {
    var sanitizedName = name;
    sanitizedName = sanitizedName.replace(/ el /gi, ' ');
    sanitizedName = sanitizedName.replace(/ la /gi, ' ');
    sanitizedName = sanitizedName.replace(/ los /gi, ' ');
    sanitizedName = sanitizedName.replace(/ las /gi, ' ');
    sanitizedName = sanitizedName.replace(/ de /gi, ' ');
    sanitizedName = sanitizedName.replace(/ del /gi, ' ');
    sanitizedName = sanitizedName.replace(/ temporada /gi, ' ');
    sanitizedName = string_to_slug(sanitizedName);
    sanitizedName = sanitizedName.replace(/--/gi, '-');
    sanitizedName = sanitizedName.replace(/---/gi, '-');
    sanitizedName = sanitizedName.replace(/----/gi, '-');
    $("#slug").val(sanitizedName);
  }

</script>
{% endblock %}
{% block content %}
        <h1>KeyWord</h1>
        <form action="/admin/kws/{{ itemkey }}/save/" method="post">
        
        <div class="line en">
          <div class="field">
            <input id="word" name="word" type="text" size="65" value="{{ kw.word }}" onblur="generateUrl(this.value);" />
          </div>
          <div class="field">
            <input id="slug" name="slug" type="text" size="50" value="{{ kw.slug }}" />
          </div>
        </div>

        <input type="submit" value="Guardar" id="save" name="save" /><br class="clear" />
      </form>
      <br class="clear" />

{% endblock %}
      